<%--
    Document   : UserSetting
    Created on : 2011-9-30, 14:37:43
    Author     : Cong
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
        <title>View Threads</title>
        <link rel="stylesheet" type="text/css" href="resource/main_page/main-page.css" />
        <script type="text/javascript" language="JavaScript" src="resource/main_page/main_page.js"></script>
        <script type="text/javascript" language="JavaScript" src="resource/view_threads/thread.js"></script>
    </head>

    <body onkeydown="try{keyCodes(event);}catch(e){}">
        <div class="main-wrap">
            <div id="user-nav">
                <%@ include file="ForumHead.jsp" %>
            </div>
            <div id="main">
                <style type="text/css">
                    .t table tr.tr2 td.f{width:22%;}
                    .t table tr.tr2 td.e{width:10em;}
                </style>
                <div class="forum-info cc gray">
                    <div class="fr">
                            welcome,${session.user.unikey}
                            You may change your <s:a href="UserAction_displayProfileBasic"><b>profile</b></s:a> | <a href="LoginAction_out"><b>Logout</b></a>


                    </div>
                </div>
                <style type="text/css">
                    .tr3 td,.tr3 th{padding:4px 8px;line-height:1.3;}
                    .tr_rep{padding:0;color:#999;}
                    .tr_rep span{color:#ff6600;}
                    .threadlist{padding-left:10px;bottom:-1px;position:absolute;}
                    .threadlist a{display:block;float:left;padding:0 9px;border-bottom:0;line-height:25px;height:25px;}
                    .threadlist .bta{height:20px;line-height:20px;border:1px solid #a6cbe7;margin-left:1em;}
                    .threadlist .current,.threadlist .active{background:#ffffff;border:1px solid #c5d8e8;padding:0 8px;border-bottom:0;color:#3d75ac;}
                    .t-cate-s{border-top:1px solid #d5e6ed;margin-top:10px;}
                    .t-cate-s .threadlist2{padding:5px 10px;line-height:25px;}
                    .t-cate-s .threadlist2 a{color:#3366cc;float:left;white-space:nowrap;padding:0 10px;}
                    .t-cate-s .threadlist2 .current{ font-weight:700;}
                    .t-cate-s .p10 span{float:left;margin:0 20px 10px 0; height:25px; white-space:nowrap;}
                    .t-cate-s .p10 input{ vertical-align:middle;}
                    .t-cate-s .p10 .btn{margin:0 5px;}
                    .t_search{border:1px solid #a6cbe7;background:#ffffff;margin-left:5px;height:18px;overflow:hidden;}
                    .t_s_ip{border:1px solid #fff;padding:1px 2px 0;float:left;height:15px; font:12px/14px Arial;background:#fff; width:85px;}
                    .t_s_btn{float:left;background:#f3f9fb url(resource/view_threads/t_search.png) center -1px no-repeat;border:1px solid #fff;border-left:1px solid #d5e6ed; cursor:pointer;width:25px;height:18px;overflow:hidden;}
                    .t_search input::-moz-focus-inner{border-color:transparent!important;}
                </style>
                <div id="breadCrumb" class="cc">
                    <s:url id="url_view" value="ThreadAction_listThreads">
                        <s:param name="categoryID" value="categoryID"/>
                        <s:param name="categoryName" value="categoryName"/></s:url>
                    <img style="cursor:pointer" id="td_cate" src="resource/view_threads/home.gif" align="absmiddle" /> <a href="main.jsp" title="ELEC_Forum">ELEC Forum</a> &raquo; <s:a href="%{url_view}">${session.categoryName}</s:a>
                </div>
                <div class="c"></div>
                <div class="c" id="c"></div>
                <div class="t3 cc">
                    <span class="fr"><a href="newThread.jsp" title="New Thread"><img src="resource/view_threads/post.png" id="td_post" /></a></span>
                    <div style="padding-top:8px;" class="cc">
                        <!-- search thread -->
                        <div class="t_search fl">
                            <form name="sF" action="" method="post">
                                <input type="text" class="t_s_ip gray" name="keyword" onfocus="if(this.value=='Section Search') this.value='';" onblur="if(this.value=='') this.value='Section Search';" value="Section Search" /><input name="submit" type="submit" class="t_s_btn" value=" " />
                            </form>
                        </div>
                    </div>
                </div>
                <div class="t z" style="margin:auto">
                    <table cellspacing="0" cellpadding="0" width="100%" id="ajaxtable">
                        <tr><th class="h" colspan="6">
                                <div class="pr cc" style="height:30px;">
                                    <div class="fn fl threadlist">
                                        <s:url id="url_all" value="ThreadAction_listThreads">
                                            <s:param name="categoryID" value="#session.categoryID"/>
                                            <s:param name="categoryName" value="#session.categoryName"/>
                                        </s:url>
                                        <s:a id="thread_type_all" href="%{url_all}">All</s:a>
                                        <span id="t_typedb">
                                            <a id="thread_type_recommended" href="">Recommended</a>
                                        </span>
                                    </div>
                                </div>
                                <script language="javascript">
                                    setCurrent('thread_type_recommended','thread_type_recommended','current');
                                </script>
                            </th>
                        </tr>
                        <tbody style="table-layout:fixed;">
                            <tr class="tr2">
                                <td style="width:2%" class="tac y-style"></td>
                                <td>
                                    Top
                                </td>
                        <script language="JavaScript">
                            var orderThreadsClass = {
                                orderThreads : function(orderway){
                                    var orderway = orderway || 'lastpost';
                                    var form = document.createElement("form");
                                    form.action = "thread.php?fid=4&page=1&";
                                    form.method = "post";
                                    var h_type = this.createInput("hidden","type","");
                                    var h_search = this.createInput("hidden","search","1000");
                                    var h_special = this.createInput("hidden","special","");
                                    var h_orderway = this.createInput("hidden","orderway",orderway);
                                    var h_asc = this.createInput("hidden","asc","DESC");
                                    form.appendChild(h_type);
                                    form.appendChild(h_search);
                                    form.appendChild(h_special);
                                    form.appendChild(h_orderway);
                                    form.appendChild(h_asc);
                                    document.body.appendChild(form);
                                    setTimeout(function(){/*ie6*/
                                        form.submit();
                                    },0);
                                    return false;
                                },
                                createInput : function(type,name,value){
                                    var hidden = document.createElement("input");
                                    hidden.type = type;
                                    hidden.name = name;
                                    hidden.value = value;//¡ý
                                    return hidden;
                                }
                            }
                            function orderThreads(orderway){
                                orderThreadsClass.orderThreads(orderway);
                            }
                        </script>
                        <td style="width:120px;" class="y-style">Author</td>
                        <td style="width:80px" class="tal y-style">Reply/View</td>
                        <td style="width:120px;" class="y-style">Latest Post</td>
                        <s:if test="(#session.user.role.roleId == 2)||(#session.user.role.roleId == 3)"><td style="width:120px;" class="y-style">Operation</td></s:if>
                        <s:iterator value="tops">
                            <s:url id="url_viewThread" value="ThreadAction_viewThread">
                                        <s:param name="categoryID" value="categoryID"/>
                                        <s:param name="categoryName" value="categoryName"/>
                                        <s:param name="threadID" value="threadId"/></s:url>
                        <tr align="middle" class="tr3 t_one">
                            <td class="tac"><s:a title="Open Article" href="" target="_blank"><img src="resource/view_threads/topicnew.gif" border=0 align="absmiddle"></s:a></td>
                            <th>&nbsp <s:a href="%{url_viewThread}" id="a_ajax_4" class="subject"><b><font color=#FF0000>Sticky: <s:property value="threadTitle"/></font></b></s:a></th>
                            <td class="tal y-style"><a href=" " class="bl"><s:property value="user.unikey"/></a></td>
                            <td class="tal y-style"><a href="notice.php?fid=4#0"><span><s:property value="replyTimes"/></span>/<s:property value="viewTimes"/></a></td>
                            <td class="y-style f10"><s:date name="lastReply" format="yyyy-MM-dd HH:mm"/></td>
                            <s:if test="(#session.user.role.roleId == 2)||(#session.user.role.roleId == 3)">
                            <td class="tal y-style"> <s:url id="url_delete" value="ThreadActionAdmin_delete">
                                        <s:param name="categoryID" value="categoryID"/>
                                        <s:param name="categoryName" value="categoryName"/>
                                        <s:param name="threadID" value="threadId"/></s:url>
                                <s:url id="url_setting" value="ThreadActionAdmin_setting">
                                        <s:param name="thID" value="categoryID"/>
                                        <s:param name="categoryName" value="categoryName"/>
                                        <s:param name="threadID" value="threadId"/></s:url>
                                <s:a href="%{url_setting}">setting</s:a> &nbsp; <s:a href="%{url_delete}">delete</s:a></td></s:if>
                        </tr>
                        </s:iterator>
                        <tr class="tr2"><td colspan="6" class="tac" style="border-top:0">General Topic</td></tr>
                        <s:iterator value="threads">
                            <s:url id="url_viewThread" value="ThreadAction_viewThread">
                                        <s:param name="categoryID" value="categoryID"/>
                                        <s:param name="categoryName" value="categoryName"/>
                                        <s:param name="threadID" value="threadId"/></s:url>
                            <tr align="center" class="tr3 t_one">
                                <td><s:a title="Open Article" href="%{url_viewThread}" target="_blank"><img src="resource/view_threads/topicnew.gif" border=0 align="absmiddle"></s:a></td>
                                <td class="tal" id="td_4">
                                    <s:a href="%{url_viewThread}" id="a_ajax_4" class="subject"><s:if test="highlight"><b><font color=#0000FF><s:property value="threadTitle"/></font></b></s:if>
                                        <s:else><s:property value="threadTitle"/></s:else></s:a>&nbsp;
                                </td>
                                <td class="tal y-style"><a href=" " class="bl"><s:property value="user.unikey"/></a>
                                </td>
                                <td class="tal y-style f10 tr_rep"><span><s:property value="replyTimes"/></span>/<s:property value="viewTimes"/></td>
                                <td class="f10 gray"><s:date name="lastReply" format="yyyy-MM-dd HH:mm"/></td>
                                <s:if test="(#session.user.role.roleId == 2)||(#session.user.role.roleId == 3)">
                                <s:url id="url_delete" value="ThreadActionAdmin_delete">
                                        <s:param name="categoryID" value="categoryID"/>
                                        <s:param name="categoryName" value="categoryName"/>
                                        <s:param name="threadID" value="threadId"/></s:url>
                                <s:url id="url_setting" value="ThreadActionAdmin_setting">
                                        <s:param name="thID" value="categoryID"/>
                                        <s:param name="categoryName" value="categoryName"/>
                                        <s:param name="threadID" value="threadId"/></s:url>
                                    <td class="tal y-style"><s:a href="%{url_setting}">setting</s:a> &nbsp; <s:a href="%{url_delete}">delete</s:a></td></s:if>
                            </s:iterator>
                        <tr><td colspan="6" class="f_one" style="height:8px"></td></tr>
                        </tbody>
                    </table></div>
                page <s:property value="now"/> of <s:property value="pageCount"/>&nbsp;&nbsp;
                <s:url id="url_pre" value="ThreadAction_listThreads">
                    <s:param name="categoryID" value="categoryID"/>
                    <s:param name="categoryName" value="categoryName"/>
                    <s:param name="now" value="now-1"/>
                </s:url>
                <s:url id="url_first" value="ThreadAction_listThreads">
                    <s:param name="categoryID" value="categoryID"/>
                    <s:param name="categoryName" value="categoryName"/>
                    <s:param name="now" value="1"/>
                </s:url>
                <s:url id="url_next" value="ThreadAction_listThreads">
                    <s:param name="categoryID" value="categoryID"/>
                    <s:param name="categoryName" value="categoryName"/>
                    <s:param name="now" value="now+1"/>
                </s:url>
                <s:url id="url_last" value="ThreadAction_listThreads">
                    <s:param name="categoryID" value="categoryID"/>
                    <s:param name="categoryName" value="categoryName"/>
                    <s:param name="now" value="pageCount"/>
                </s:url>
                <s:a href="%{url_first}">first</s:a>
                <s:if test="now!=1">
                    <s:a href="%{url_pre}">pre</s:a>
                </s:if>
                <s:if test="now!=pageCount">
                    <s:a href="%{url_next}">next</s:a>
                </s:if>
                <s:a href="%{url_last}">last</s:a>
            </div>
        </div>
    </body>
</html>
<script language="JavaScript" src="resource/main_page/fast_access.js"></script>
<%@ include file="ForumFoot.jsp" %>